Skip to content

ci/compose/schema: migrate to github.com/santhosh-tekuri/jsonschema/v6 - #7195

Draft
thaJeztah wants to merge 1 commit into
docker:masterfrom
thaJeztah:modern_jsonschema
Draft

ci/compose/schema: migrate to github.com/santhosh-tekuri/jsonschema/v6#7195
thaJeztah wants to merge 1 commit into
docker:masterfrom
thaJeztah:modern_jsonschema

Conversation

@thaJeztah

@thaJeztah thaJeztah commented Aug 15, 2026

Copy link
Copy Markdown
Member

Size is slightly larger, but not dramatic (+514,560 bytes);

Before/after

ls -l ./build/docker-darwin-arm64
-rwxr-xr-x  1 thajeztah  staff  39800754 Aug 15 16:48 ./build/docker-darwin-arm64*

ls -l ./build/docker-darwin-arm64
-rwxr-xr-x  1 thajeztah  staff  40315314 Aug 15 16:48 ./build/docker-darwin-arm64*

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah added this to the 29.8.0 milestone Aug 15, 2026
@thaJeztah thaJeztah added status/2-code-review area/stack kind/refactor PR's that refactor, or clean-up code labels Aug 15, 2026
@codecov-commenter

codecov-commenter commented Aug 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.21429% with 30 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cli/compose/schema/schema.go 73.21% 26 Missing and 4 partials ⚠️

📢 Thoughts on this report? Let us know!

@thaJeztah
thaJeztah force-pushed the modern_jsonschema branch 3 times, most recently from 9b7a816 to 6c0a976 Compare August 15, 2026 15:24
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates Compose schema validation to jsonschema/v6, updating error formatting and vendored dependencies.

Changes:

  • Replaces gojsonschema validation and custom error handling.
  • Updates schema and loader test expectations.
  • Vendors jsonschema/v6 and required x/text packages.

Reviewed changes

Copilot reviewed 5 out of 123 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
vendor/modules.txt Updated as part of this pull request.
vendor/golang.org/x/text/message/message.go Updated as part of this pull request.
vendor/golang.org/x/text/message/doc.go Updated as part of this pull request.
vendor/golang.org/x/text/message/catalog/dict.go Updated as part of this pull request.
vendor/golang.org/x/text/message/catalog.go Updated as part of this pull request.
vendor/golang.org/x/text/language/tags.go Updated as part of this pull request.
vendor/golang.org/x/text/language/doc.go Updated as part of this pull request.
vendor/golang.org/x/text/language/coverage.go Updated as part of this pull request.
vendor/golang.org/x/text/internal/tag/tag.go Updated as part of this pull request.
vendor/golang.org/x/text/internal/stringset/set.go Updated as part of this pull request.
vendor/golang.org/x/text/internal/number/roundingmode_string.go Updated as part of this pull request.
vendor/golang.org/x/text/internal/number/number.go Updated as part of this pull request.
vendor/golang.org/x/text/internal/number/common.go Updated as part of this pull request.
vendor/golang.org/x/text/internal/match.go Updated as part of this pull request.
vendor/golang.org/x/text/internal/language/tags.go Updated as part of this pull request.
vendor/golang.org/x/text/internal/language/match.go Updated as part of this pull request.
vendor/golang.org/x/text/internal/language/coverage.go Updated as part of this pull request.
vendor/golang.org/x/text/internal/language/compose.go Updated as part of this pull request.
vendor/golang.org/x/text/internal/language/compact/tags.go Updated as part of this pull request.
vendor/golang.org/x/text/internal/language/compact/compact.go Updated as part of this pull request.
vendor/golang.org/x/text/internal/language/compact.go Updated as part of this pull request.
vendor/golang.org/x/text/internal/language/common.go Updated as part of this pull request.
vendor/golang.org/x/text/internal/internal.go Updated as part of this pull request.
vendor/golang.org/x/text/internal/format/format.go Updated as part of this pull request.
vendor/golang.org/x/text/internal/catmsg/varint.go Updated as part of this pull request.
vendor/golang.org/x/text/feature/plural/message.go Updated as part of this pull request.
vendor/golang.org/x/text/feature/plural/common.go Updated as part of this pull request.
vendor/github.com/xeipuuv/gojsonschema/utils.go Updated as part of this pull request.
vendor/github.com/xeipuuv/gojsonschema/types.go Updated as part of this pull request.
vendor/github.com/xeipuuv/gojsonschema/subSchema.go Updated as part of this pull request.
vendor/github.com/xeipuuv/gojsonschema/schemaType.go Updated as part of this pull request.
vendor/github.com/xeipuuv/gojsonschema/schemaReferencePool.go Updated as part of this pull request.
vendor/github.com/xeipuuv/gojsonschema/schemaPool.go Updated as part of this pull request.
vendor/github.com/xeipuuv/gojsonschema/schemaLoader.go Updated as part of this pull request.
vendor/github.com/xeipuuv/gojsonschema/result.go Updated as part of this pull request.
vendor/github.com/xeipuuv/gojsonschema/LICENSE-APACHE-2.0.txt Updated as part of this pull request.
vendor/github.com/xeipuuv/gojsonschema/jsonContext.go Updated as part of this pull request.
vendor/github.com/xeipuuv/gojsonschema/internalLog.go Updated as part of this pull request.
vendor/github.com/xeipuuv/gojsonschema/glide.yaml Updated as part of this pull request.
vendor/github.com/xeipuuv/gojsonschema/.travis.yml Updated as part of this pull request.
vendor/github.com/xeipuuv/gojsonschema/.gitignore Updated as part of this pull request.
vendor/github.com/xeipuuv/gojsonreference/reference.go Updated as part of this pull request.
vendor/github.com/xeipuuv/gojsonreference/README.md Updated as part of this pull request.
vendor/github.com/xeipuuv/gojsonreference/LICENSE-APACHE-2.0.txt Updated as part of this pull request.
vendor/github.com/xeipuuv/gojsonpointer/README.md Updated as part of this pull request.
vendor/github.com/xeipuuv/gojsonpointer/pointer.go Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/vocab.go Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/schema.go Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/root.go Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/README.md Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/position.go Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/output.go Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2020-12/schema Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2020-12/meta/validation Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2020-12/meta/unevaluated Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2020-12/meta/meta-data Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2020-12/meta/format-assertion Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2020-12/meta/format-annotation Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2020-12/meta/core Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2020-12/meta/content Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2020-12/meta/applicator Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2019-09/schema Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2019-09/meta/validation Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2019-09/meta/meta-data Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2019-09/meta/format Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2019-09/meta/core Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2019-09/meta/content Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft/2019-09/meta/applicator Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft-07/schema Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft-06/schema Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/metaschemas/draft-04/schema Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/loader.go Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/LICENSE Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/go.work.sum Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/go.work Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/content.go Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/.pre-commit-hooks.yaml Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/.golangci.yml Updated as part of this pull request.
vendor/github.com/santhosh-tekuri/jsonschema/v6/.gitmodules Updated as part of this pull request.
vendor.sum Updated as part of this pull request.
vendor.mod Updated as part of this pull request.
cli/compose/schema/schema_test.go Updated as part of this pull request.
cli/compose/loader/loader_test.go Updated as part of this pull request.
Suppressed comments (2)

cli/compose/schema/schema.go:129

  • reflect.Value.String() returns the underlying value only for string-kind values; for an integer or interface map key it produces placeholders such as "<int Value>" or "<interface {} Value>". That changes/collapses non-string keys during conversion and can make malformed nested YAML mappings validate under permissive patternProperties. Convert supported key values explicitly (or reject non-string keys) instead of using Value.String().
    cli/compose/schema/schema.go:97
  • The migrated validator registers a custom duration format here, but the schema and loader tests do not exercise either an accepted or rejected duration. Add a regression case such as an invalid stop_grace_period so this format registration and time.ParseDuration path are covered.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 34 to +41
case string:
portSpec = p
case *big.Rat:
portSpec = strings.Split(p.String(), "/")[0]
case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, float32, float64:
portSpec = fmt.Sprint(p)
default:
return nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/stack kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants